Skip to content

释放所有内存 - FreeImageAll

函数简介

一次性释放所有通过图片加载函数分配的内存。

接口名称

FreeImageAll

DLL调用

int FreeImageAll(long ola);

参数说明

参数名类型说明
ola长整数型OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.FreeImageAll();
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.FreeImageAll();
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.FreeImageAll()
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.FreeImageAll();
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.FreeImageAll()
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.FreeImageAll()
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.FreeImageAll()
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.FreeImageAll();
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.FreeImageAll()
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int32_t ret = ola.FreeImageAll();

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
FreeImageAll(instance);
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int FreeImageAll(long ola);

long instance = CreateCOLAPlugInterFace();
FreeImageAll(instance);
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.FreeImageAll(instance)

返回值

整数型:1 成功,0 失败。

注意事项

  • 调用后所有已加载的图片句柄都将失效。
  • 如果只需释放特定图片,请使用 FreeImagePtr。